package papacharly.encheres.model;
// Generated 12 mars 2011 11:05:58 by Hibernate Tools 3.2.1.GA


import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * User generated by hbm2java
 */
@Entity
@Table(name="user"
    ,catalog="PAPACHARLY"
)
public class User  implements java.io.Serializable {


     private Integer idUser;
     private String pseudo;
     private String password;
     private String nom;
     private String prenom;
     private String adresse;
     private String email;
     private String telephone;
     private Set<Produit> produits = new HashSet<Produit>(0);
     private Set<Enchere> encheres = new HashSet<Enchere>(0);

    public User() {
    }

	
    public User(String pseudo, String password, String nom, String prenom, String adresse, String email, String telephone) {
        this.pseudo = pseudo;
        this.password = password;
        this.nom = nom;
        this.prenom = prenom;
        this.adresse = adresse;
        this.email = email;
        this.telephone = telephone;
    }
    public User(String pseudo, String password, String nom, String prenom, String adresse, String email, String telephone, Set<Produit> produits, Set<Enchere> encheres) {
       this.pseudo = pseudo;
       this.password = password;
       this.nom = nom;
       this.prenom = prenom;
       this.adresse = adresse;
       this.email = email;
       this.telephone = telephone;
       this.produits = produits;
       this.encheres = encheres;
    }
   
     @Id @GeneratedValue(strategy=IDENTITY)
    
    @Column(name="idUser", unique=true, nullable=false)
    public Integer getIdUser() {
        return this.idUser;
    }
    
    public void setIdUser(Integer idUser) {
        this.idUser = idUser;
    }
    
    @Column(name="pseudo", nullable=false, length=25)
    public String getPseudo() {
        return this.pseudo;
    }
    
    public void setPseudo(String pseudo) {
        this.pseudo = pseudo;
    }
    
    @Column(name="password", nullable=false)
    public String getPassword() {
        return this.password;
    }
    
    public void setPassword(String password) {
        this.password = password;
    }
    
    @Column(name="nom", nullable=false, length=30)
    public String getNom() {
        return this.nom;
    }
    
    public void setNom(String nom) {
        this.nom = nom;
    }
    
    @Column(name="prenom", nullable=false, length=30)
    public String getPrenom() {
        return this.prenom;
    }
    
    public void setPrenom(String prenom) {
        this.prenom = prenom;
    }
    
    @Column(name="adresse", nullable=false, length=65535)
    public String getAdresse() {
        return this.adresse;
    }
    
    public void setAdresse(String adresse) {
        this.adresse = adresse;
    }
    
    @Column(name="email", nullable=false, length=30)
    public String getEmail() {
        return this.email;
    }
    
    public void setEmail(String email) {
        this.email = email;
    }
    
    @Column(name="telephone", nullable=false, length=15)
    public String getTelephone() {
        return this.telephone;
    }
    
    public void setTelephone(String telephone) {
        this.telephone = telephone;
    }
@OneToMany(cascade=CascadeType.ALL, fetch=FetchType.LAZY, mappedBy="user")
    public Set<Produit> getProduits() {
        return this.produits;
    }
    
    public void setProduits(Set<Produit> produits) {
        this.produits = produits;
    }
@OneToMany(cascade=CascadeType.ALL, fetch=FetchType.LAZY, mappedBy="user")
    public Set<Enchere> getEncheres() {
        return this.encheres;
    }
    
    public void setEncheres(Set<Enchere> encheres) {
        this.encheres = encheres;
    }

    @Override
    public String toString() {
        return "User{" + "idUser=" + idUser + "pseudo=" + pseudo + "password=" + password + "nom=" + nom + "prenom=" + prenom + "adresse=" + adresse + "email=" + email + "telephone=" + telephone + "produits=" + produits + "encheres=" + encheres + '}';
    }
}


